<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1 {
            width: 100px;
            height: 100px;
            background-color: red;
        }
    </style>
</head>
<body>
    <button class="btn1">toggle</button>
    <div class="div1"></div>
    <script src="../0505/js/jq.js"></script>
    <script>
        $(function(){

            var div1 = $('.div1');
            var btn1 = $('.btn1');
            // 点击按钮 显示隐藏
            btn1.click(function(){
                div1.slideToggle(2000, function(){
                    // 回调函数，在动画执行完成后才会被调用
                    console.log(666);
                })
            })

        })
    </script>
</body>
</html>